#pragma once
#include <cstdint>

using namespace std;

namespace hammingWeight
{
	class Solution {
	public:
		uint32_t reverseBits(uint32_t n) {
			uint32_t r = 0;
			uint32_t d = 1;
			for (size_t i = 0; i < 32; i++)
			{
				if (n & (d << i))
				{
					r += (d << (31 - i));
				}
			}
			return r;
		}
	};
}